//
//  OperationColor.h
//  Blue-toothLight
//
//  Created by mazg on 15/6/16.
//  Copyright (c) 2015年 mazg. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "LightModel.h"

//typedef enum {
//    K_Jianbian=1,
//    K_Shanshuo,
//} ChangeColorType;

@interface OperationColor : NSObject

@property (nonatomic,strong) UIColor *currentColor;
@property (nonatomic,strong) NSMutableArray *changeColorArr;//将要变化的颜色数组
@property (nonatomic,assign) NSTimeInterval timeInterval; //颜色变化所需要的时间
@property (nonatomic,assign) int counter;
@property (nonatomic,assign) BOOL alwaysChange;


+(instancetype)shareOperationColorInstance;
//最简单的颜色变化(从一个颜色变为另一个颜色，这里需要给蓝牙设备发送数据并且修改model里面的信息)
-(void)changeColorWithPeripheral:(CBPeripheral *)peripheral ToTarget:(UIColor *)targetColor;

-(void)changeColorWithPeripheral:(CBPeripheral *)peripheral ToTarget:(UIColor *)targetColor afterDelay:(NSTimeInterval)delay;

//该方法中开启定时器，不停往设备发送颜色变化的数据
-(void)changeColorWithPeripheral:(CBPeripheral *)peripheral ToTargetWith_Jianbian:(NSMutableArray *)changeColorArr;
-(void)changeColorWithPeripheral:(CBPeripheral *)peripheral ToTargetWith_Kuaishan:(NSMutableArray *)changeColorArr;
-(void)changeColorWithPeripheral:(CBPeripheral *)peripheral ToTargetWith_Manshan:(NSMutableArray *)changeColorArr;

-(void)openLightWithPeripheral:(CBPeripheral *)peripheral;
-(void)turnOffLightWithPeripheral:(CBPeripheral *)peripheral;

@end
